//haven't add output_iringbuf() yet
#include <stdio.h>
#include <string.h>
#include <log.h>
#define IRINGBUF_LENGTH 128
#define IRINGBUF_NUM 10
static char iringbuf[IRINGBUF_NUM][IRINGBUF_LENGTH];
int p = 0;
int p_last = 0;
//write information into iringbuf
void w_iringbuf(char* str){
				memset(iringbuf,'\0',strlen(iringbuf[p]));
				strcpy(iringbuf[p],str);
				if(p<9) {p_last = p;p++;}
				else {p_last = p;p = 0;}
}	
//add "<--" to the latest inst and output all log in the buf
void output_iringbuf(){
	char end[4] = "<--";	
	for(int i = 0; i<IRINGBUF_NUM;i++){
		if(i == p_last) strcat(iringbuf[i],end);
		log_write("%s\n",iringbuf[i]);
	}
}
